<template>
<div>
<h2 class='name'>我是{{name}}</h2>
<button @click = "sendName">把学生名字发给School组件</button>
</div>
</template>

<script>
export default {
    name:'Student',
    data(){
        return {
            name:'学生'
        }
    },
    methods: {
        sendName(){
            this.x.$emit('hello',this.name)
        }
    },
}
</script>


<style>
    .name{
        background: lightblue;
    }
</style>